home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / initrd.lz / initrd / scripts / casper-bottom / 18hostname < prev    next >
Encoding:
Text File  |  2009-10-28  |  577 b   |  40 lines

  1. #! /bin/sh
  2.  
  3. PREREQ=""
  4. DESCRIPTION="Setting hostname..."
  5.  
  6. . /scripts/casper-functions
  7.  
  8. prereqs()
  9. {
  10.        echo "$PREREQ"
  11. }
  12.  
  13. case $1 in
  14. # get pre-requisites
  15. prereqs)
  16.        prereqs
  17.        exit 0
  18.        ;;
  19. esac
  20.  
  21. log_begin_msg "$DESCRIPTION"
  22.  
  23. echo "$HOST" > /root/etc/hostname
  24. cat > /root/etc/hosts <<EOF
  25. 127.0.0.1 localhost
  26. 127.0.1.1 $HOST
  27.  
  28. # The following lines are desirable for IPv6 capable hosts
  29. ::1     ip6-localhost ip6-loopback
  30. fe00::0 ip6-localnet
  31. ff00::0 ip6-mcastprefix
  32. ff02::1 ip6-allnodes
  33. ff02::2 ip6-allrouters
  34. ff02::3 ip6-allhosts
  35.  
  36. EOF
  37. hostname "$HOST"
  38.  
  39. log_end_msg
  40.